Skip to main content

Graph Theory


Eulerian Trails

Definition

If the graph GG has the property that for any two vertices xx and yy, one can find a path from xx and yy, then we say that GG is a connected graph.

Definition

If a graph GG has no loops and has no multiple edges between the same pair of points, then we will say that GG is a simple graph.

Definition

A sequence of distinct edges e1e2eke_1e_2 \cdots e_k is called a trail if we can take a continuous walk in our graph. A walk is like a trail, except that all edges do not need to be distinct.

If a trail uses all edges of GG, then we call it an Eulerian trail. If a trail does not touch any vertex twice, then we call it a path.

Theorem

A connected graph GG has a closed Eulerian trail if and only if all vertices of GG have an even degree.

Proof

First, we prove the "only if" part, that is, we show that if GG has a closed Eulerian trail, then all vertices of GG must have an even degree. Indeed, when we take the closed Eulerian trail WW, we visit each vertex a certain number of times. Let AA be a vertex that was not where WW started, and assume we visited AA exactly aa times. This means we entered AA exactly aa times, and we left AA exactly aa times. As we assumed WW was a trail, we had to do this using different edges, so we used 2a2 a edges. On the other hand, WW contains all edges of GG, so AA cannot have any additional edges, therefore the degree of AA is 2a2 a. This shows that the degree of any vertex other than the starting point SS of WW is even. Finally, note that SS is not only the starting point of WW, but also the endpoint, so if we visit SS exactly tt times between the start and the end of WW, then we use 1+2t+1=2(t+1)1+2 t+1=2(t+1) edges. Therefore, the degree of SS is 2(t+1)2(t+1), and our claim is proved.

Now let us assume that all vertices of GG have an even degree and prove that GG has a closed Eulerian trail. Take any vertex SS, and start walking along an edge e1e_1, to the other endpoint A1A_1 of that edge, then walk along any new edge e2e_2 that starts in A1A_1. Continue this way, using new (previously unused) edges at each step, until a closed trail C1C_1 is formed. As GG is finite, such a closed trail will always be formed. The first closed trail will be formed when we first revisit a vertex already visited. We cannot get stuck at some vertex before completing a closed trail as each vertex has an even degree, so each time we enter a vertex, we can also leave it, except possibly the initial vertex. If C1=GC_1=G, then we are done. If not, then choose a vertex VV in C1C_1 so that C1C_1 does not contain all edges adjacent to VV.

The alert reader can ask now how we know that there is such a vertex VV. Let us assume that there is not. As C1C_1 contains fewer edges than GG, and supposedly C1C_1 contains all edges adjacent to all vertices it contains, there must be a vertex AA that is not in C1C_1. However, GG is a connected graph, so there must be a path connecting AA to any vertex in C1C_1. Start walking on this path from AA to any given vertex of C1C_1. When you reach C1C_1 the first time, you will reach it in a vertex VV that is in C1C_1, but not all the edges adjacent to it are in C1C_1. Indeed, the one that has just ended in VV is not. This proves by contradiction that such a vertex VV always exists. Illustrated here:

Let us now remove all edges of C1C_1 from GG. We get a graph in which again all vertices have an even degree. Starting at VV, let us take another closed trail C2C_2 in the remaining graph. We can then unite C1C_1 and C2C_2 into one closed trail in GG. Indeed, if we start walking by C1C_1, we can stop at VV, walk through C2C_2, then complete our trail by using the remaining part of C1C_1. If the new trail C1C2C_1 \cup C_2 contains all edges of GG, we are done. If not, then let us omit C1C2C_1 \cup C_2 from GG, and find a new closed trail C3C_3 in the remaining graph.

As GG has a finite number of edges, this procedure has to stop after a finite number of steps. Therefore, after a finite number of steps, C1C2CkC_1 \cup C_2 \cup \cdots \cup C_k will be a closed trail containing all edges of GG.


Hamiltonian Cycles

Definition

A cycle in a graph is a closed trail that does not touch any vertex twice, except, the initial vertex, which must also be the ending vertex. A cycle that includes all vertices of a graph is called a Hamiltonian path.

Theorem

Let n3n \geq 3, let GG be a simple graph on nn vertices, and let us assume that all vertices in GG are of degree at least n/2n / 2. Then GG has a Hamiltonian cycle.

Proof

Note that it follows from the conditions that GG is connected. Indeed, if GG had more than one component, then it would have a component of less than n/2n / 2 vertices, and vertices in that component would have a degree less than n/2n / 2.

Let us assume that GG does not have a Hamiltonian cycle. Let us add new edges to GG as long as we can without creating a Hamiltonian cycle. When we stop, we have a graph GG^{\prime} in which all vertices have a degree at least n/2n / 2, there is no Hamiltonian cycle, but adding any new edge would create a Hamiltonian cycle.

Let PP be a path of maximum length in GG^{\prime}. We claim that PP contains all vertices of GG^{\prime}. Indeed let xx and yy be two vertices in GG^{\prime} that are not connected by an edge. As adding the edge xyx y would create a Hamiltonian cycle, it follows that GG^{\prime} has a Hamiltonian path PP that starts at xx and ends iny\operatorname{in} y.

Let x=z1,z2,z3,,zn1,zn=yx=z_1, z_2, z_3, \cdots, z_{n-1}, z_n=y be the vertices of this path, from xx to yy. Vertices xx and yy together have at least nn neighbors. Therefore, the Pigeon-hole Principle implies that there must be an index ii so that 2in12 \leq i \leq n-1, while xzix z_i is an edge, and also, zi1yz_{i-1} y is an edge. (Otherwise the set of neighbors of yy and the set of vertices that immediately precede a neighbor of xx on the xyx y-path would be disjoint, which is impossible since these sets are too large.) This is a contradiction, however, for this would mean that xz2zi1yzn1zix z_2 \cdots z_{i-1} y z_{n-1} \cdots z_i is a Hamiltonian cycle as shown below.


Directed Graphs

Definition

A graph in which each edge is assigned a direction is called a directed graph or digraph.

Theorem 1

A directed graph GG has a closed Eulerian trail if and only if it is balanced and strongly connected.

Proof

First, we prove that these conditions are necessary. As a closed Eulerian trail WW leaves each vertex as many times as it enters that vertex, GG must be balanced. Similarly, WW provides a trail from any vertex to any vertex, so GG is strongly connected.

Theorem 2

All tournaments have a Hamiltonian path. Proof. We prove the claim by induction on nn, the number of vertices of our tournament TT. If TT has one, or two vertices, then the statement is clearly true. Now assume that we know the statement for all tournaments having n1n-1 vertices. Let TT be any tournament on nn vertices. Separate any vertex VV, and call the remaining graph on n1n-1 vertices TT^{\prime}. By the induction hypothesis, TT^{\prime} has a Hamiltonian path h=h1h2hn1h=h_1 h_2 \cdots h_{n-1}. The question is how we can insert VV into hh. If there is an index ii so that hiVh_i V is an edge and Vhi+1V h_{i+1} is an edge, then we can insert VV between hih_i and hi+1h_{i+1}. If no such ii exists, then there must exist an index kk so that 0kn10 \leq k \leq n-1, and for all jk,Vhjj \leq k, V h_j is an edge, and for all j>k,hjVj>k, h_j V is an edge. Therefore, either Vh1V h_1 is an edge, or hn1Vh_{n-1} V is an edge. So we can affix VV either to the front or to the end of hh.

Theorem 3

A tournament TT has a Hamiltonian cycle if and only if it is strongly connected.

Proof

If TT has a Hamiltonian cycle, then that cycle provides a directed path from any vertex to any vertex, so GG is strongly connected.

Now let us assume that TT is strongly connected, and let E(T)E(T) denote the set of edges of TT. First, we prove that TT does contain a cycle. Indeed, if it did not, then xyE(T)x y \in E(T) and yzE(T)y z \in E(T) would imply xzE(T)x z \in E(T), so TT would be a transitive tournament. In such a tournament, the vertices can be listed from left to right so that ijE(T)i j \in E(T) if and only if jj is on the right of ii. However, such a tournament is not strongly connected as no paths go to the right. So TT does have a cycle.

Let C=y1y2ykC=y_1 y_2 \cdots y_k be a cycle of maximal length in TT, and assume CC is not a Hamiltonian cycle. As TT is strongly connected, it contains an edge from CC to some vertex xx that is not in CC. We can assume without loss of generality that this edge is y1xy_1 x. If xy2x y_2 were an edge, then y1xy2y3yky_1 x y_2 y_3 \cdots y_k would be a cycle having more vertices than CC. Therefore, y2xy_2 x has to be an edge, and then similarly, y3x,y4x,,ykxy_3 x, y_4 x, \cdots, y_k x must all be edges.

Let ZZ be the set of all vertices zz so that y1zE(T)y_1 z \in E(T). Then yizE(T)y_i z \in E(T) for all zZz \in Z and all i[k]i \in[k] by the same argument as the one we applied for yixy_i x in the previous paragraph. Let ztz t be an edge, with zZz \in Z, and tZt \notin Z. Such an edge exists as TT is strongly connected. Then tCt \notin C, and therefore tZt \notin Z implies that ty1E(T)t y_1 \in E(T). Then, however, zty1y2y3ykz t y_1 y_2 y_3 \cdots y_k is a longer cycle than CC. The figure below shows our construction. This contradiction completes the proof.


Isomorphisms

Definition

We say that graphs GG and HH are isomorphic if there is a bijection ff from the vertex set of GG onto that of HH so that the number of edges between any pair of vertices XX and YY of GG is equal to the number of edges between vertices f(X)f(X) and f(Y)f(Y) of HH. The bijection ff is called an isomorphism.